package com.yssystem.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yssystem.domain.SysOperLog;
import com.yssystem.domain.vo.R;
import com.yssystem.service.SysOperLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

@RestController
@CrossOrigin
@RequestMapping("operLog")
public class OPerLogController {
    @Autowired
    private SysOperLogService sysOperLogService;

    @GetMapping
    public R getLogList(Integer current, Integer size, String opname, String moname){
        IPage page = new Page<>(current, size);
        QueryWrapper<SysOperLog> queryWrapper = new QueryWrapper<>();
        queryWrapper.like(opname!=null,"oper_name",opname).like(moname!=null,"title",moname);

        return new R(true,"查找",sysOperLogService.pageMaps(page, queryWrapper));
    }



}
